package com.ihr360.binlog.model;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * Created by davidwei on 17-7-20.
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class SyncTaskOverview {
    public DataSyncState state;
    public int totalCnt;
    public int processed=0;
    public String tableName;
    public String schemaName;
    public long timeCost;
    public String message;
    public SyncTaskOverview() {
        reset();
    }

    public static SyncTaskOverview noSchemaAndTable(){
        SyncTaskOverview overview =  new SyncTaskOverview();
        overview.state = DataSyncState.NO_SCHEMA_TABLE;
        return overview;
    }

    public void reset(){
        this.state = DataSyncState.IDLE;
        this.totalCnt = 0;
        this.processed = 0;
        this.tableName = null;
        this.schemaName = null;
        this.message = null;
    }
}
